#include "event/Event_GameObject_Moved.h"



using namespace Boon;


Boon::Event_GameObject_Moved::Event_GameObject_Moved( GameObjectID id )
	:	MessengerEventBase(),
		m_GameObjID( id )
{

}


const EventType Boon::Event_GameObject_Moved::GetEventID() const
{
	return ID;
}

void Boon::Event_GameObject_Moved::Serialize( std::ostream& out ) const
{
	
}

Boon::IMessengerEventStrong Boon::Event_GameObject_Moved::Copy() const
{
	Shared_ptr<Event_GameObject_Moved> cpy( new Event_GameObject_Moved( m_GameObjID ) );
	cpy->SetMatrix( &m_MatToW, &m_MatFromW );
	return cpy;
}

const char* Boon::Event_GameObject_Moved::GetName() const
{
	return "Event_SNode_Update_Transform";
}

void Boon::Event_GameObject_Moved::GetMatrix( Matrix44* const outToWorld, Matrix44* const outFromWorld ) const
{
	if( outToWorld )
		*outToWorld = m_MatToW;
	if( outFromWorld )
		*outFromWorld = m_MatFromW;
}

void Boon::Event_GameObject_Moved::SetMatrix( const Matrix44* const toWorld, const Matrix44* const fromWorld )
{
	if( toWorld )
		m_MatToW = *toWorld;
	if( fromWorld )
		m_MatFromW = *fromWorld;
}

const GameObjectID Boon::Event_GameObject_Moved::GetGameObjectID() const
{
	return m_GameObjID;
}

const Matrix44& Boon::Event_GameObject_Moved::GetMatrixFromWorld() const
{
	return m_MatFromW;
}

const Matrix44& Boon::Event_GameObject_Moved::GetMatrixToWorld() const
{
	return m_MatToW;
}
